<!---
	Title:		EPAR1.1 
	Author:		Bruce Frick
	Purpose:	index page
--->

<cfset BASE = CreateObject("component", "#session.rootDir#.cfc.base") />
<cfset statusQueries = CreateObject("component", "#session.rootDir#.cfc.statusQueries") />
<cfset mainQueries = CreateObject("component", "#session.rootDir#.cfc.queries") />
<cfinclude template="/code_lib/SCF_Employee.cfm">
<cfinclude template="/code_lib/SCF_HR.cfm">
<cfinclude template="/code_lib/SCF_REGEX.cfm">
<cfoutput>
<!---HTML header, css links, js links, and page title--->
#BASE.htmlTerminationHeader(
	"", <!---JS links--->
    "", <!---CSS links--->
    "Term Status Report", <!---Page Title--->
    "Status" <!---Active Nav Link--->
)#
<!---HTML header, css links, js links, and page title--->


<cfif Session.strAuthType NEQ ''>
	
    <h1 class="title">Status Report</h1>
    <div class="entry">
    	Welcome, #Session.arrEmpInfo.FirstName# #Session.arrEmpInfo.LastName#.  
        This page details the Steps in the Creation process and lists the number 
        of employees staged in each queue.  
        <BR /> <BR />
        
        <cfform name="frmTermStatus">
        
        	<cfset QUERIES = {} />
        	
            <cfset QUERIES.GetStepDetail = statusQueries.funcGetStepDetailTermination() />
            
            <table align="center">
            
            <cfloop query="QUERIES.GetStepDetail">
                            
                <cfset QUERIES.GetTerminationSCFStepWaiting = statusQueries.funcGetTerminationSCFStepWaiting(QUERIES.GetStepDetail.ID) />
                <cfset QUERIES.GetTerminationSCFStepWaitingManual = statusQueries.funcGetTerminationSCFStepWaiting(23) />
                <cfset QUERIES.GetTerminationNonSCFStepWaiting = statusQueries.funcGetTerminationNonSCFStepWaiting(QUERIES.GetStepDetail.ID) />
                
                <cfif QUERIES.GetStepDetail.ID EQ 22><!--- For manual termination --->
                
                    <tr>
	                    <td valign="top" colspan="3">
	                        <span class="tableHeader">
	                            Manual: System Termination (#QUERIES.GetTerminationSCFStepWaiting.recordcount + QUERIES.GetTerminationNonSCFStepWaiting.recordcount#)
	                        </span>     
	                    </td>
	                </tr>
	                <tr>
	                    <td width="25">&nbsp;</td>
	                    <td valign="top"> 
	                        <table>
	                            <tr>               
	                                <td>
	                                    <strong>
	                                    <cfif (Session.strAuthType EQ #QUERIES.GetStepDetail.AppGroup# OR Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR) AND QUERIES.GetStepDetail.Page_Home NEQ "">
	                                        <!--- <a href="Step3-ExecTermManually.cfm"> --->SCF EMPLOYEES<!--- </a> --->  
	                                    <cfelse>
	                                        SCF EMPLOYEES 
	                                    </cfif>
	                                    </strong>     
	                                </td>
	                            </tr>
	                            <cfif QUERIES.GetTerminationSCFStepWaiting.recordcount GT 0>
	                                <cfloop query="QUERIES.GetTerminationSCFStepWaiting">
	                                    <cfset QUERIES.WFCEmployeeObj = SCF_Employee_GetEmployee(QUERIES.GetTerminationSCFStepWaiting.RosettaID)>
	                                    <tr>                  
	                                        <td>
	                                            <cfset Display = QUERIES.WFCEmployeeObj.FirstName & ' ' & QUERIES.WFCEmployeeObj.LastName />                                    
	                                            <cfif (Session.strAuthType EQ #QUERIES.GetStepDetail.AppGroup# OR Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR) and QUERIES.GetStepDetail.Page_UserDirect NEQ ''>
	                                                <a href="Step3-ExecTermManually.cfm?TermReqID=#QUERIES.GetTerminationSCFStepWaiting.TermReqID#">#Display#</a>
	                                            <cfelse>
	                                                #Display#
	                                            </cfif>
	                                        </td>
	                                    </tr>
	                                </cfloop>	                            
	                            </cfif>
                                <!--- MANUAL TERMS  --->
                                <cfif QUERIES.GetTerminationSCFStepWaitingManual.recordcount GT 0>
                                    <cfloop query="QUERIES.GetTerminationSCFStepWaitingManual">
                                        <cfset QUERIES.WFCEmployeeObj = SCF_Employee_GetEmployee(QUERIES.GetTerminationSCFStepWaitingManual.RosettaID)>
                                        <tr>                  
                                            <td>
                                                <cfset Display = QUERIES.WFCEmployeeObj.FirstName & ' ' & QUERIES.WFCEmployeeObj.LastName />                                    
                                                <cfif (Session.strAuthType EQ #QUERIES.GetStepDetail.AppGroup# OR Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR) and QUERIES.GetStepDetail.Page_UserDirect NEQ ''>
                                                    <a href="Step3-ExecTermManually.cfm?TermReqID=#QUERIES.GetTerminationSCFStepWaitingManual.TermReqID#">#Display#</a>
                                                <cfelse>
                                                    #Display#
                                                </cfif>
                                            </td>
                                        </tr>
                                    </cfloop>
                                <cfelse>
	                                <tr>           
	                                    <td>
	                                        <span class="error">At the present time, there are not any employees staged for this step.</span>
	                                    </td>
	                                </tr>
                                </cfif>
	                        </table>
	                    </td>
	                    <td valign="top"> 
	                        <table>
	                            <tr>     
	                                <td width = 25>&nbsp;</td>            
	                                <td>
	                                    <strong>                                            
	                                    <cfif (Session.strAuthType EQ #QUERIES.GetStepDetail.AppGroup# OR Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR) AND QUERIES.GetStepDetail.NonSCFPage_Home NEQ "">
	                                        CONTRACTORS
	                                    <cfelse>
	                                        CONTRACTORS
	                                    </cfif>
	                                    </strong>
	                                </td>
	                            </tr>
	                            <cfif QUERIES.GetTerminationNonSCFStepWaiting.recordcount GT 0>
	                                <cfloop query="QUERIES.GetTerminationNonSCFStepWaiting">
	                                    <cfset QUERIES.WFCEmployeeObj = mainQueries.funcGettPersonsObj( mainQueries.funcGetRosettaObj( QUERIES.GetTerminationNonSCFStepWaiting.RosettaID ) ) />
	                                    
	                                    <tr>     
	                                        <td>&nbsp;</td>            
	                                        <td>
	                                            <cfif (Session.strAuthType EQ #QUERIES.GetStepDetail.AppGroup# OR Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR) and QUERIES.GetStepDetail.NonSCFPage_UserDirect NEQ ''>
	                                                <a href="#QUERIES.GetStepDetail.NonSCFPage_UserDirect#?TermReqID=#QUERIES.GetTerminationNonSCFStepWaiting.TermReqID#">
	                                                    #QUERIES.WFCEmployeeObj.FirstName & ' ' & QUERIES.WFCEmployeeObj.LastName#
	                                                </a>
	                                            <cfelse>
	                                                #QUERIES.WFCEmployeeObj.FirstName & ' ' & QUERIES.WFCEmployeeObj.LastName#
	                                            </cfif>
	                                        </td>
	                                    </tr>
	                                </cfloop>
	                            <cfelse>
	                            <tr>     
	                                <td>&nbsp;</td>        
	                                <td>
	                                    <span class="error">At the present time, there are not any contractors staged for this step.</span>
	                                </td>
	                            </tr>
	                            </cfif>
	                        </table>
	                    </td>
	                </tr>
	                <tr>           
	                    <td>&nbsp;
	                        
	                    </td>
	                </tr>
                </cfif>
                <!--- Manual Termination --->
                
                
                <tr>
                    <td valign="top" colspan="3">
                        <span class="tableHeader">
                            #QUERIES.GetStepDetail.StepDesc# (#QUERIES.GetTerminationSCFStepWaiting.recordcount + QUERIES.GetTerminationNonSCFStepWaiting.recordcount#)
                        </span>     
                    </td>
                </tr>
                <tr>
                    <td width="25">&nbsp;</td>
                    <td valign="top"> 
                        <table>
                            <tr>               
                                <td>
                                    <strong>
                                    <cfif (Session.strAuthType EQ #QUERIES.GetStepDetail.AppGroup# OR Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR) AND QUERIES.GetStepDetail.Page_Home NEQ "">
                                        <a href="#QUERIES.GetStepDetail.Page_Home#">SCF EMPLOYEES</a>  
                                    <cfelse>
                                        SCF EMPLOYEES 
                                    </cfif>
                                    </strong>     
                                </td>
                            </tr>
                            <cfif QUERIES.GetTerminationSCFStepWaiting.recordcount GT 0>
                                <cfloop query="QUERIES.GetTerminationSCFStepWaiting">
                                    <cfset QUERIES.WFCEmployeeObj = SCF_Employee_GetEmployee(QUERIES.GetTerminationSCFStepWaiting.RosettaID)>
		                            <tr>                  
		                                <td>
		                                    <cfif QUERIES.GetStepDetail.ID EQ 23>
		                                        <cfset Display = QUERIES.WFCEmployeeObj.FirstName & ' ' & QUERIES.WFCEmployeeObj.LastName & " (" & DateFormat(QUERIES.GetTerminationSCFStepWaiting.TermDate, 'm/dd/yyyy') & ", " & DateFormat(QUERIES.GetTerminationSCFStepWaiting.SysTermDate, 'm/dd/yyyy') & ") " >
		                                    <cfelse>												
		                                        <cfset Display = QUERIES.WFCEmployeeObj.FirstName & ' ' & QUERIES.WFCEmployeeObj.LastName />
		                                    </cfif>                                    
		                                    <cfif (Session.strAuthType EQ #QUERIES.GetStepDetail.AppGroup# OR Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR) and QUERIES.GetStepDetail.Page_UserDirect NEQ ''>
		                                        <a href="#QUERIES.GetStepDetail.Page_UserDirect#?TermReqID=#QUERIES.GetTerminationSCFStepWaiting.TermReqID#">#Display#</a>
		                                    <cfelse>
		                                        #Display#
		                                    </cfif>
		                                </td>
		                            </tr>
                                </cfloop>
                            <cfelse>
                            <tr>           
                                <td>
                                    <span class="error">At the present time, there are not any employees staged for this step.</span>
                                </td>
                            </tr>
                            </cfif>
                        </table>
                    </td>
                    <td valign="top"> 
                        <table>
                            <tr>     
                                <td width = 25>&nbsp;</td>            
                                <td>
                                    <strong>                                           	
                                    <cfif (Session.strAuthType EQ #QUERIES.GetStepDetail.AppGroup# OR Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR) AND QUERIES.GetStepDetail.NonSCFPage_Home NEQ "">
                                        <a href="#QUERIES.GetStepDetail.NonSCFPage_Home#">CONTRACTORS</a>  
                                    <cfelse>
                                        CONTRACTORS
                                    </cfif>
                                    </strong>
                                </td>
                            </tr>
                            <cfif QUERIES.GetTerminationNonSCFStepWaiting.recordcount GT 0>
                                <cfloop query="QUERIES.GetTerminationNonSCFStepWaiting">
                                    <cfset QUERIES.WFCEmployeeObj = mainQueries.funcGettPersonsObj( mainQueries.funcGetRosettaObj( QUERIES.GetTerminationNonSCFStepWaiting.RosettaID ) ) />
                                    
		                            <tr>     
		                                <td>&nbsp;</td>            
		                                <td>
		                                    <cfif (Session.strAuthType EQ #QUERIES.GetStepDetail.AppGroup# OR Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR) and QUERIES.GetStepDetail.NonSCFPage_UserDirect NEQ ''>
		                                        <a href="#QUERIES.GetStepDetail.NonSCFPage_UserDirect#?TermReqID=#QUERIES.GetTerminationNonSCFStepWaiting.TermReqID#">
		                                            #QUERIES.WFCEmployeeObj.FirstName & ' ' & QUERIES.WFCEmployeeObj.LastName#
		                                        </a>
		                                    <cfelse>
		                                        #QUERIES.WFCEmployeeObj.FirstName & ' ' & QUERIES.WFCEmployeeObj.LastName#
		                                    </cfif>
		                                </td>
		                            </tr>
                                </cfloop>
                            <cfelse>
                            <tr>     
                                <td>&nbsp;</td>        
                                <td>
                                    <span class="error">At the present time, there are not any contractors staged for this step.</span>
                                </td>
                            </tr>
                            </cfif>
                        </table>
                    </td>
                </tr>
                <tr>           
                    <td>&nbsp;
                        
                    </td>
                </tr>
            </cfloop>
            </table>
    
        </cfform>
    
    </div>

<cfelse>
    <cfinclude template="../denied.cfm">
</cfif>


<!---HTML footer, closes html and body tags.  Any footer info goes here--->
#BASE.htmlTerminationFooter()#
<!---HTML footer, closes html and body tags.  Any footer info goes here--->
</cfoutput>